package com.ruoyi.project.data.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.data.domain.WorksAllRecords;
import com.ruoyi.project.data.domain.WorksRecords;
import com.ruoyi.project.data.service.IDatWorksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/system/works")
public class DatWorksController extends BaseController {
    @Autowired
    private IDatWorksService iDatWorksService;

    @PreAuthorize("@ss.hasPermi('data:works:list')")
    @GetMapping("/list1")
    public AjaxResult list1(WorksRecords worksRecords){
        List<WorksRecords> list =iDatWorksService.findWorksRecords(worksRecords);
        return AjaxResult.success(list);
    }
    @GetMapping("/list2")
    public AjaxResult list2(WorksAllRecords worksAllRecords){
        List<WorksAllRecords> list =iDatWorksService.findWorksAllRecords(worksAllRecords);
        return AjaxResult.success(list);
    }
}
